import moment from 'moment';
// 命名规范：Arr普通枚举  field下拉字段枚举  Map表格字段枚举

// 表头筛选字段
const headerForm = {};
// 表格字段
const tableColumn = {
  // 表格列表
  appointmentTableMap: [
    {
      prop: 'id',
      label: 'ID',
      type: 'text',
    },
    {
      prop: 'manUsername',
      label: '男方用户名',
      type: 'text',
    },
    {
      prop: 'womanUsername',
      label: '女方用户名',
      type: 'text',
    },
    {
      prop: 'promoterUserUsername',
      label: '申请方用户名',
      type: 'text',
    },
    {
      prop: 'acceptUserUsername',
      label: '接受方用户名',
      type: 'text',
    },
    {
      prop: 'staffName',
      label: '负责人',
      type: 'text',
    },
    {
      prop: 'appointmentStatus',
      label: '约会状态',
      type: 'text',
      optionKey: 'APPOINTMENT_STATUS',
      tooltip: true
    },
    {
      prop: 'followUpStatus',
      label: '回访状态',
      type: 'text',
      optionKey: 'CALLBACK_STATUS',
    },
    {
      prop: 'meetSignStatus',
      label: '见面签到状态',
      type: 'text',
      optionKey: 'SIGN_STATUS',
      tooltip: true
    },
    {
      prop: 'meetStatus',
      label: '见面状态',
      type: 'text',
      optionKey: 'SIGN_MEET_STATUS',
    },
    {
      prop: 'meetTime',
      label: '见面时间',
      type: 'text',
    },
    {
      prop: 'replyTime',
      label: '回访时间',
      type: 'text',
    },
    // {
    //   prop: 'createTime',
    //   label: '创建时间',
    //   type: 'text',
    // },
    // {
    //   prop: 'updateTime',
    //   label: '更新时间',
    //   type: 'text',
    // },
  ],
};
// 表单字段
const editForm = {
  // 筛选表单
  appointmentFilterMap: [
    {
      prop: 'id',
      type: 'input',
      label: 'ID',
      clearable: true,
      col: 0,
    },
    {
      prop: 'manUsername',
      type: 'input',
      label: '男方用户名',
      clearable: true,
      col: 0,
    },
    {
      prop: 'womanUsername',
      type: 'input',
      label: '女方用户名',
      clearable: true,
      col: 0,
    },
    {
      prop: 'promoterUserUsername',
      type: 'input',
      label: '申请方用户名',
      clearable: true,
      col: 0,
    },
    {
      prop: 'staffName',
      type: 'input',
      label: '负责人姓名',
      clearable: true,
      col: 0,
    },
    {
      prop: 'followUpStatus',
      type: 'select',
      label: '回访状态',
      clearable: true,
      filterable: true,
      optionKey: 'CALLBACK_STATUS',
      col: 0,
    },
    {
      prop: 'meetSignStatus',
      type: 'select',
      label: '见面签到状态',
      clearable: true,
      filterable: true,
      optionKey: 'SIGN_STATUS',
      col: 0,
    },
    {
      prop: 'meetStatus',
      type: 'select',
      label: '见面状态',
      clearable: true,
      filterable: true,
      optionKey: 'SIGN_MEET_STATUS',
      col: 0,
    },
    {
      prop: 'promoterUserUsername',
      type: 'select',
      label: '申请方',
      clearable: true,
      filterable: true,
      optionKey: 'APPLICANT_STATUS',
      col: 0,
    },
    {
      prop: 'meetTime',
      startProp: 'meetTimeStartTime',
      endProp: 'meetTimeEndTime',
      label: '见面时间',
      type: 'datePicker',
      dateType: 'datetimerange',
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      pickerOptions: {
        disabledDate: function (time) {
          return time.getTime() > moment().format('x');
        },
      },
      clearable: true,
      col: 0,
      xs: 12,
      sm: 12,
      md: 8,
      lg: 8,
      xl: 6,
    },
    {
      prop: 'replyTime',
      startProp: 'replyTimeStartTime',
      endProp: 'replyTimeEndTime',
      label: '回访时间',
      type: 'datePicker',
      dateType: 'datetimerange',
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      pickerOptions: {
        disabledDate: function (time) {
          return time.getTime() > moment().format('x');
        },
      },
      clearable: true,
      col: 0,
      xs: 12,
      sm: 12,
      md: 8,
      lg: 8,
      xl: 6,
    },
    // {
    //   prop: 'createTime',
    //   startProp: 'createTimeStartTime',
    //   endProp: 'createTimeEndTime',
    //   label: '创建时间',
    //   type: 'datePicker',
    //   dateType: 'datetimerange',
    //   format: 'yyyy-MM-dd HH:mm:ss',
    //   valueFormat: 'yyyy-MM-dd HH:mm:ss',
    //   pickerOptions: {
    //     disabledDate: function (time) {
    //       return time.getTime() > moment().format('x');
    //     },
    //   },
    //   clearable: true,
    //   width: 100,
    //   col: 0,
    //   xs: 12,
    //   sm: 12,
    //   md: 8,
    //   lg: 8,
    //   xl: 6,
    // },
    // {
    //   prop: 'updateTime',
    //   startProp: 'updateTimeStartTime',
    //   endProp: 'updateTimeEndTime',
    //   label: '更新时间',
    //   type: 'datePicker',
    //   dateType: 'datetimerange',
    //   format: 'yyyy-MM-dd HH:mm:ss',
    //   valueFormat: 'yyyy-MM-dd HH:mm:ss',
    //   pickerOptions: {
    //     disabledDate: function (time) {
    //       return time.getTime() > moment().format('x');
    //     },
    //   },
    //   clearable: true,
    //   width: 100,
    //   col: 0,
    //   xs: 12,
    //   sm: 12,
    //   md: 8,
    //   lg: 8,
    //   xl: 6,
    // },
  ],
  appointConfirmFormMap:[
    {
      prop: 'meetAddress',
      type: 'input',
      label: '见面地址',
      clearable: true,
      col: 24,
    },
    {
      prop: 'meetTime',
      type: 'datePicker',
      label: '见面时间',
      clearable: true,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      pickerOptions: {
        disabledDate: function (time) {
          return time.getTime() > moment().format('x');
        },
      },
      col: 24,
    },
    {
      prop: 'operateName',
      type: 'input',
      label: '操作人',
      clearable: true,
      col: 24,
    },
    {
      prop: 'staffId',
      labelProp: 'staffName',
      type: 'select',
      label: '负责人',
      clearable: true,
      filterable: true,
      optionDynamic: {
        apiKey: 'adminList',
        params: {},
        methods: 'get',
      },
      optionValue: 'userId',
      optionLabel: 'userName',
      col: 24,
    },
  ],
  appointViewFormMap: [
    {
      prop: 'manUsername',
      type: 'input',
      label: '男方用户名',
      disabled: true,
      col: 24,
    },
    {
      prop: 'womanUsername',
      type: 'input',
      label: '女方用户名',
      disabled: true,
      col: 24,
    },
    {
      prop: 'promoterUserUsername',
      type: 'input',
      label: '申请方用户名',
      disabled: true,
      col: 24,
    },
    {
      prop: 'staffName',
      type: 'input',
      label: '负责人姓名',
      disabled: true,
      col: 24,
    },
    {
      prop: 'followUpStatus',
      type: 'select',
      label: '回访状态',
      disabled: true,
      filterable: true,
      optionKey: 'CALLBACK_STATUS',
      placeholder: ' ',
      col: 24,
    },
    {
      prop: 'meetSignStatus',
      type: 'select',
      label: '见面签到状态',
      disabled: true,
      placeholder: ' ',
      optionKey: 'SIGN_STATUS',
      col: 24,
    },
    {
      prop: 'meetStatus',
      type: 'select',
      label: '见面状态',
      disabled: true,
      placeholder: ' ',
      optionKey: 'SIGN_MEET_STATUS',
      col: 24,
    },
    {
      prop: 'promoterUserUsername',
      type: 'select',
      label: '申请方',
      disabled: true,
      placeholder: ' ',
      optionKey: 'APPLICANT_STATUS',
      col: 24,
    },
    {
      prop: 'meetTime',
      label: '见面时间',
      type: 'datePicker',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      pickerOptions: {
        disabledDate: function (time) {
          return time.getTime() > moment().format('x');
        },
      },
      disabled: true,
      col: 24,
    },
    {
      prop: 'replyTime',
      label: '回访时间',
      type: 'datePicker',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      pickerOptions: {
        disabledDate: function (time) {
          return time.getTime() > moment().format('x');
        },
      },
      disabled: true,
      col: 24,
    },
  ]
};
// 其他映射
const otherMap = {};
// 表单字段校验
const editRule = {
  appointConfirmFormRule: {
    categoryName: [{ required: true, message: '题库不能为空', trigger: 'blur' }],
    status: [{ required: true, message: '请选择状态', trigger: 'change' }],
  },
};
export default {
  headerForm,
  tableColumn,
  editForm,
  otherMap,
  editRule,
};
